package com.aaron.factorymethod.factory;

import com.aaron.factorymethod.product.HuaweiHonor;
import com.aaron.factorymethod.product.HuaweiMate;
import com.aaron.factorymethod.product.HuaweiP9;
import com.aaron.factorymethod.product.IProduct;

public class HuaweiFactory implements IFactory {
	
	public static final String HUAWEI_P9   = "huawei_p9";
	public static final String HUAWEI_MATE = "huawei_mate";
	public static final String HUAWEI_HONOR= "huawei_honor";
	
	@Override
	public IProduct makePhone(String name) {
		// TODO Auto-generated method stub
		IProduct product = null;
		switch(name){
		case HUAWEI_P9:   product = new HuaweiP9();    break;
		case HUAWEI_MATE: product = new HuaweiMate();  break;
		case HUAWEI_HONOR:product = new HuaweiHonor(); break;
		default: System.out.println("we can not make the phone named \""+name+"\""); break;
		}
		return product;
	}

	@Override
	public void repairPhone(IProduct product) {
		// TODO Auto-generated method stub
		product.repair();
	}

}
